﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style x:Key="ProfileListItemStyle"
           TargetType="ListBoxItem">
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="FontWeight"
                Value="SemiBold" />
        <Setter Property="Foreground"
                Value="#373a3d" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected"
                                 Value="True">
                            <Setter Property="Foreground"
                                    Value="Black" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                    <Grid Background="{TemplateBinding Background}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="overColor"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="selectedColor"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="overColor"
                                   Visibility="Hidden"
                                   Fill="#ebebeb"
                                   IsHitTestVisible="False" />
                        <Rectangle x:Name="selectedColor"
                                   Visibility="Hidden"
                                   Fill="#d8d8d8"
                                   IsHitTestVisible="False" />
                        <ContentPresenter x:Name="contentPresenter"
                                          Content="{TemplateBinding Content}"
                                          ContentTemplate="{TemplateBinding ContentTemplate}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          Margin="25 5 0 5" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ProfileListHeaderStyle"
           TargetType="TextBlock">
        <Setter Property="FontWeight"
                Value="UltraBold" />
        <Setter Property="FontSize"
                Value="11" />
        <Setter Property="Margin"
                Value="25 5 0 15" />
    </Style>

    <Style x:Key="ProfileListStyle"
           TargetType="ListBox">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBox">
                    <DockPanel>
                        <TextBlock DockPanel.Dock="Top"
                                   Style="{StaticResource ProfileListHeaderStyle}">
                            <TextBlock Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Items.Count}" />
                            <TextBlock Text="PROFILES" />
                        </TextBlock>
                        <ScrollViewer Style="{StaticResource ListScrollViewerStyle}">
                            <ItemsPresenter />
                        </ScrollViewer>
                    </DockPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemContainerStyle"
                Value="{StaticResource ProfileListItemStyle}" />
    </Style>
</ResourceDictionary>